@extends('app')

@section('content')
<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>
<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/enterprise/job_type')}}">职位分类</a></li>
    <li><a href="{{ url('/admin/enterprise/job_type/create') }}">添加</a></li>
</ul>

<div class="panel panel-default description2 mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>分类名称</th>
                    <th>首页推荐</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach($category as $key=>$cg)
                <tr id="news_{{ $cg->cat_id }}">
                    <td>
                        <font color="#428bca">@if(count($cg->childrenCates) > 0)
                        <i class="icon-chevron-down" id="father_{{$cg->cat_id}}"></i>
                        @endif
                        {{ $cg->name }}</font>
                    </td>
                    <td id="disabled">
                        @if($cg->is_recommond == 1)
                         <span class="glyphicon glyphicon-ok-circle  green-remove"
                            onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $cg->cat_id }}', '{{ $cg->is_recommond }}', '{{ csrf_token() }}')"></span>
                        @else
                        <span class="glyphicon glyphicon-remove-circle red-ok"
                                  onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $cg->cat_id }}', '{{ $cg->is_recommond }}', '{{ csrf_token() }}')"></span>
                        @endif
                    </td>
                    <td>{{ $cg->sort }}</td>
                    <td>
                        <a href="{{ url('/admin/enterprise/job_type/create?catid='.$cg->cat_id) }}"><i class="icon-plus-sign"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="{{ url('/admin/enterprise/job_type/'.$cg->cat_id.'/edit') }}"><i class="icon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="javascript:void(0);" onclick="delete_one('/admin/enterprise/job_type/{{$cg->cat_id}}','{{$cg->cat_id}}','{{ csrf_token() }}')"><i class="icon-remove-sign"></i></a>
                    </td>
                </tr>
                    @foreach($cg->childrenCates as $subc)
                    <tr id="news_{{ $subc->cat_id }}">
                        <td>
                            ｜－－ {{ $subc->name }} 
                            @if(count($subc->childrenCates) > 0)
                            <font color="#428bca"><i class="icon-chevron-down" style="margin-left:20px;" id="father_{{$cg->cat_id}}"></i></font>
                            @endif
                        </td>
                        <td id="disabled">
                            @if($subc->is_recommond == 1)
                             <span class="glyphicon glyphicon-ok-circle  green-remove"
                                onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $subc->cat_id }}', '{{ $subc->is_recommond }}', '{{ csrf_token() }}')"></span>
                            @else
                            <span class="glyphicon glyphicon-remove-circle red-ok"
                                      onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $subc->cat_id }}', '{{ $subc->is_recommond }}', '{{ csrf_token() }}')"></span>
                            @endif
                        </td>
                        <td>{{ $subc->sort }}</td>
                        <td>
                            <a href="{{ url('/admin/enterprise/job_type/create?catid='.$subc->cat_id) }}"><i class="icon-plus-sign"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="{{ url('/admin/enterprise/job_type/'.$cg->cat_id.'/edit?secondcatid='.$subc->cat_id) }}"><i class="icon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:void(0);" onclick="delete_one('/admin/enterprise/job_type/{{$subc->cat_id}}','{{$subc->cat_id}}','{{ csrf_token() }}')"><i class="icon-remove-sign"></i></a>
                        </td>
                    </tr>
                         @foreach($subc->childrenCates as $thirdc)
                            <tr  id="news_{{ $thirdc->cat_id }}">
                                <td>
                                    ｜－－－－ {{ $thirdc->name }}
                                </td>
                                <td id="disabled">
                                    @if($thirdc->is_recommond == 1)
                                     <span class="glyphicon glyphicon-ok-circle  green-remove"
                                        onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $thirdc->cat_id }}', '{{ $thirdc->is_recommond }}', '{{ csrf_token() }}')"></span>
                                    @else
                                    <span class="glyphicon glyphicon-remove-circle red-ok"
                                              onclick="changeUserStatus('/admin/enterprise/job_type/recommond','{{ $thirdc->cat_id }}', '{{ $thirdc->is_recommond }}', '{{ csrf_token() }}')"></span>
                                    @endif
                                </td>
                                <td>{{ $thirdc->sort }}</td>
                                <td>
                                    <a href="#"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="{{ url('/admin/enterprise/job_type/'.$cg->cat_id.'/edit?secondcatid='.$subc->cat_id.'&thirdcatid='.$thirdc->cat_id) }}"><i class="icon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="javascript:void(0);" onclick="delete_one('/admin/enterprise/job_type/{{$thirdc->cat_id}}','{{$thirdc->cat_id}}','{{ csrf_token() }}')"><i class="icon-remove-sign"></i></a>
                                    
                                </td>
                            </tr>
                         @endforeach
                    @endforeach
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
